package com.zzedu.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zzedu.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 大屏管理对象 zz_app_device
 *
 * @author Mr.Wang
 * @date 2025-06-02
 */
@TableName("zz_app_device")
public class ZzAppDevice implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 设备序列号
     */
    @Excel(name = "设备序列号")
    private String deviceSn;

    /**
     * 设备mac
     */
    @Excel(name = "设备mac")
    private String deviceMac;

    /**
     * 对应学校
     */
    @Excel(name = "对应学校")
    private Long schoolId;

    /**
     * 绑定时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "绑定时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime bindDate;

    /**
     * 绑定IP
     */
    private String bindIp;

    /**
     * 绑定code
     */
    private Long bindId;

    /**
     * 最后登录ip
     */
    @Excel(name = "最后登录ip")
    private String lastLoginIp;

    /**
     * 最后登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginDate;

    /**
     * 最后登录人
     */
    @Excel(name = "最后登录人")
    private Long lastLoginUserId;

    /**
     * 状态 0-正常 1暂停
     */
    @Excel(name = "状态 0-正常 1暂停")
    private Integer state;

    /**
     * 添加时间
     */
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime gmtCreate;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime gmtModify;

    /**
     * 逻辑删除(0：未删除 1：id)
     */
    @TableLogic(delval = "id")
    @TableField(fill = FieldFill.INSERT)
    private Integer deleted;

    /**
     * 创建人
     */
    @TableField(fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * 修改人
     */
    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;

    /**
     * 上次计算在线时间
     */
    private LocalDateTime preLineTime;

    /**
     * 在线时长
     */
    private Long lineTime;

    /**
     * 绑定位置
     */
    private String bindLocation;
    /**
     * 最新操作位置
     */
    private String lastOperationLocation;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceMac(String deviceMac) {
        this.deviceMac = deviceMac;
    }

    public String getDeviceMac() {
        return deviceMac;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setBindDate(LocalDateTime bindDate) {
        this.bindDate = bindDate;
    }

    public LocalDateTime getBindDate() {
        return bindDate;
    }

    public void setBindIp(String bindIp) {
        this.bindIp = bindIp;
    }

    public String getBindIp() {
        return bindIp;
    }

    public void setBindId(Long bindId) {
        this.bindId = bindId;
    }

    public Long getBindId() {
        return bindId;
    }

    public void setLastLoginIp(String lastLoginIp) {
        this.lastLoginIp = lastLoginIp;
    }

    public String getLastLoginIp() {
        return lastLoginIp;
    }

    public void setLastLoginDate(LocalDateTime lastLoginDate) {
        this.lastLoginDate = lastLoginDate;
    }

    public LocalDateTime getLastLoginDate() {
        return lastLoginDate;
    }

    public void setLastLoginUserId(Long lastLoginUserId) {
        this.lastLoginUserId = lastLoginUserId;
    }

    public Long getLastLoginUserId() {
        return lastLoginUserId;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getState() {
        return state;
    }

    public void setGmtCreate(LocalDateTime gmtCreate) {
        this.gmtCreate = gmtCreate;
    }

    public LocalDateTime getGmtCreate() {
        return gmtCreate;
    }

    public void setGmtModify(LocalDateTime gmtModify) {
        this.gmtModify = gmtModify;
    }

    public LocalDateTime getGmtModify() {
        return gmtModify;
    }

    public void setDeleted(Integer deleted) {
        this.deleted = deleted;
    }

    public Integer getDeleted() {
        return deleted;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public Long getCreateBy() {
        return createBy;
    }

    public void setUpdateBy(Long updateBy) {
        this.updateBy = updateBy;
    }

    public Long getUpdateBy() {
        return updateBy;
    }

    public LocalDateTime getPreLineTime() {
        return preLineTime;
    }

    public void setPreLineTime(LocalDateTime preLineTime) {
        this.preLineTime = preLineTime;
    }

    public Long getLineTime() {
        return lineTime;
    }

    public void setLineTime(Long lineTime) {
        this.lineTime = lineTime;
    }

    public String getBindLocation() {
        return bindLocation;
    }

    public void setBindLocation(String bindLocation) {
        this.bindLocation = bindLocation;
    }

    public String getLastOperationLocation() {
        return lastOperationLocation;
    }

    public void setLastOperationLocation(String lastOperationLocation) {
        this.lastOperationLocation = lastOperationLocation;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }
}
